<extend name="Public/base" />

<block name="body">
    <!-- 标题栏 -->
    <div class="main-title">
        <h2>用户列表</h2>
    </div>
   <div class="main-title">
        <h2>属性列表</h2>
    </div>
    <div class="cf">
        <div class="fl">
            <a class="btn" href="{:U('Attrval/add',array('gid'=>$gid,'kid'=>$kid))}">新增</a>
        </div>

        <!-- 高级搜索 -->
        <div class="search-form fr cf">
            <div class="sleft">
                <input type="text" name="nickname" class="search-input" value="" placeholder="请输入属性描述或者ID">
                <a class="sch-btn" href="javascript:;" id="search" url="/index.php/Admin/Attr/index.html"><i class="btn-search"></i></a>
            </div>
        </div>
    </div>

    <!-- 数据列表 -->
    <div class="data-table table-striped">
    <table class="">
    <thead>
        <tr>
        <th class="row-selected row-selected"><input class="check-all" type="checkbox"/></th>
        <th class="">属性值</th>
        <th class="">属性类别id</th>
        <th class="">属性类别</th>
        <th class="">商品id</th>
        <th class="">商品名称</th>
        <th class="">操作</th>

        </tr>
    </thead>
    <tbody>
    <volist name="res" id="v">
       <tr>
            <td><input class="ids" type="checkbox" name="id[]" value="12" /></td>
            <td>{$v.value}</td>
            <td>
                {$v.kid}
            </td>
            <td>{$attr.name}</td>
            <td>{$v.gid}</td>
            <td>{$goods.name}</td>

            <td>
                <a href="{:U('Attrval/edit',array('id'=>$v['id'],'gid'=>$v['gid'],'kid'=>$v['kid']))}" class="">修改</a>
                <a href="/index.php/Admin/Attr/del/id/12.html" class="confirm ajax-get">删除</a>
            </td>
        </tr> 

    </volist>
        
         </tbody>
    </table>
    </div>
    <div class="page">
        {$_page}
    </div>
</block>

<block name="script">
    <script src="__STATIC__/thinkbox/jquery.thinkbox.js"></script>

    <script type="text/javascript">
    //搜索功能
    $("#search").click(function(){
        var url = $(this).attr('url');
        var query  = $('.search-form').find('input').serialize();
        query = query.replace(/(&|^)(\w*?\d*?\-*?_*?)*?=?((?=&)|(?=$))/g,'');
        query = query.replace(/^&/g,'');
        if( url.indexOf('?')>0 ){
            url += '&' + query;
        }else{
            url += '?' + query;
        }
        window.location.href = url;
    });
    //回车搜索
    $(".search-input").keyup(function(e){
        if(e.keyCode === 13){
            $("#search").click();
            return false;
        }
    });
    //导航高亮
    highlight_subnav('{:U('User/index')}');
    </script>
</block>
